CFLAGS=-Wall
LDFLAGS=-lole32 -mwindows
CC=gcc
TOOLS=wemsconfiggui.exe

VPATH=..

.SUFFIXES: .exe .rc

compile: ${TOOLS}

wemsconfiggui.exe: wemsconfiggui.o wemsconfigguires.o util.o obd_pid.o serial.o

util.o: util.c obd_pid.c
serial.o: serial.c
obd_pid.o: obd_pid.c

.rc.o:
	windres ${<} ${@}
.c.o:
	${CC} -c ${<} ${CFLAGS}

.o.exe:
	${CC} -o ${@} ${^} ${LDFLAGS}

clean:
	rm -f ${TOOLS} *.core *.o
